﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;

namespace DataLibrary
{
    public class Ctbl_Faq_Lang:IData<tbl_Faq_Lang>
    {
        public Ctbl_Faq_Lang() { }
        public Ctbl_Faq_Lang(String myconnecString) : base(myconnecString) { }

        public override List<tbl_Faq_Lang> GetAll(tbl_Faq_Lang item)
        {
            throw new NotImplementedException();
        }

        public override tbl_Faq_Lang GetItemById(object id)
        {
            return GetAll().SingleOrDefault(p => p.IdFaqLang == Convert.ToInt32(id));
        }

        public override tbl_Faq_Lang GetItem(System.Data.IDataReader dr)
        {
            tbl_Faq_Lang obj = new tbl_Faq_Lang();
            obj.FaqQuestion = Convert.ToString(dr[tbl_Faq_Lang.c_faqQuestion]);
            obj.FaqReply = Convert.ToString(dr[tbl_Faq_Lang.c_faqReply]);
            obj.IdFaq = Convert.ToInt32(dr[tbl_Faq_Lang.c_idFaq]);
            obj.IdFaqLang = Convert.ToInt32(dr[tbl_Faq_Lang.c_idFaqLang]);
            obj.IdLang = Convert.ToInt32(dr[tbl_Faq_Lang.c_idLang]);
            return obj;
        }

        public override List<tbl_Faq_Lang> GetAll()
        {
            String strSQL = "select * from " +tbl_Faq_Lang.b_tbl_Faq_Lang;
            return GetAll(strSQL, CommandType.Text);
        }

        protected override int InsertOnSubmit(tbl_Faq_Lang item, int t)
        {
            throw new NotImplementedException();
        }
    }
}
